@import "../../../scss/plugin";

.diary-list-item{
  cursor: pointer;
  background-color: white;
  display: block;
  flex-flow: row nowrap;
  height: $height-list;
  &:last-child{
    .detail{
      border: 0;
    }
  }
  &:hover{
    background-color: $bg-list-active;
  }
  .category{
    float: left;
    width: $width-category-sign;
    height: $height-list;
    display: block;
  }
  .date{
    float: left;
    width: $width-index-date;
    padding: 0 5px;
    flex-shrink: 0;
    text-align: center;
    line-height: $height-list;
    font-size: $fz-list-content;
    font-weight: bold;
    color: $text-date;
    &.weekday-short{
      font-weight: normal;
      font-size: $fz-small;
      color: $text-label;
    }
  }
  .detail{
    position: relative;
    display: flex;
    padding-right: 8px;
    margin-left: 35px;
    .title{
      flex-grow: 1;
      flex-shrink: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      line-height: $height-list;
      display: block;
      font-size: $fz-list-content;
      color: $text-title;
    }
    .icon{
      flex-shrink: 0;
      padding: 4px 0;
      height: $height-list;
      width: $height-list - 4 * 2;
      display: block;
    }
    .bill-amount{
      padding-right: 10px;
      font-size: $fz-small;
      color: $text-label;
      line-height: $height-list;
      flex-grow: 1;
      text-align: right;
      &.bill-in{
        //font-weight: bold;
        color: lighten(desaturate($magenta, 20%), 0%);
      }
    }
    &:after{
      bottom: 0;
      left: 0;
      content: '';
      display: block;
      width: 100%;
      position: absolute;
      border-bottom: 1px solid $color-border-light;
      transform-origin: 0 100%;
      @include transform(scaleY(0.5));
    }
  }
  &.active{
    .title, .date{
      color: white;
      text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
    }
    .detail{
      &:after{
        content: none;
      }
    }
    .bill-amount{
      color: white!important;
    }
  }
}


@media (max-width: $grid-separate-width-sm) {
  .diary-list-item{
    .date{
      font-size: $fz-list-content-mobile;
    }
    .detail{
      .title{
        font-size: $fz-list-content-mobile;
      }
    }
  }
}





@media (prefers-color-scheme: dark) {
  // LIST ITEM
  .diary-list-item{
    background-color: $dark-list-bg;
    &:hover{
      background-color: $dark-list-bg-active;
    }
    .date{
      color: $dark-text;
    }
    .detail{
      .title{
        color: $dark-text-title;
      }
      .bill-amount{
        &.bill-in{
          color: lighten(desaturate($magenta, 10%), 20%);
        }
      }
      &:after{
        border-bottom-color: $dark-border;
      }
    }

    &.active{
      .title, .date{
        color: white;
        text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
      }
      .detail{
        &:after{
          content: none;
        }
      }
    }
  }
}
